{include file="public/admin_head.html"}
<body>
	<ul class="breadcrumb">
		{if $show_operator}
		<li class="active">
			<a href="./index.php?act=admin&st=adminAdd">添加用户</a><span class="divider">/</span>       
	    </li>
	    {/if}
	    <li class="active">
			<a href="./index.php?act=admin&st=adminEdit">修改密码</a><span class="divider">/</span>       
	    </li>
		<li class="active">
			<a href="./index.php?act=admin&st=adminLogoutAction">退出登录</a>       
	    </li>
	</ul>
     <!-- <table>
        <tr>
            <td class="span2" style="text-align: right;">
                <div class="control-group">
                    <label class="control-group" for="fm_searchbox">用户搜索：</label>
                </div>
            </td>
            <td class="span3">
                <div class="input-append">
                    <input class="span2" id="fm_searchbox" type="text">
                    <button class="btn" type="button" onclick="select_chg('keyword', 'fm_searchbox');">搜索</button>
                </div>
            </td>
            <td>
         </tr>
    </table> -->
<table class="table table-bordered table-striped" align="center">
	<tr>
		<th style="width: 150px;">用户ID</th>
		<th style="width: 150px;">用户名称</th>
		<th style="width: 100px;">角色</th>
		<th style="width: 100px;">登录次数</th>
		<th style="width: 130px;">最后一次登录IP</th>
		<th style="width: 130px;">最后一次登录时间</th>
		{if $show_operator}
		<th style="width: 200px;">操作用户</th>
		{/if}
	</tr>
{foreach item=adminUser from=$allUsers}
<tr>
	<td style="width: 50px;">{$adminUser.admin_user_id}</td>
	<td style="width: 100px;">{$adminUser.user_name}</td>
	<td style="width: 100px;">{$adminType[$adminUser.admin_type]}</td>
	<td style="width: 100px;">{$adminUser.login_count}</td>
	<td style="width: 130px;">{if $adminUser.last_login_ip!=''}{$adminUser.last_login_ip}{else}&nbsp;&nbsp;{/if}</td>
	<td style="width: 130px;">{$adminUser.last_login_time}</td>
	{if $show_operator}
	<td style="width: 200px;">
		<a class="btn" href="/index.php?act=admin&st=adminEdit&userid={$adminUser.admin_user_id}">编辑</a>
	 	<button class="btn btn-warning" type="button" onclick="checkDel({$adminUser.admin_user_id});">删除</button>
	</td>
	{/if}
</tr>
{/foreach}
<table  width="100%">
	<tr>
		<td class="form-actions pagination" align="center">{$pageShow}</td>
	</tr>
</table>
</table>
<script type="text/javascript">
function checkDel(user_id) {
	if(confirm("你确定要删除这个用户吗？")) {
		$.ajax({
			data:{'user_id':user_id},
			url:'/index.php?act=admin&st=adminDelete',
			type:"GET",
			timeout:15000,
			dataType:'json',
			success:function(data) {
				if(typeof data.result != 'undefined' && data.result =='ok') {
					window.location.reload();
				} else if(typeof data.result != 'undefined' && data.result =='offline') {
					alert("您尚未登录或者登录已超时，请重新登录！");
					window.location.href = '/index.php?act=admin&st=adminLogin';
				}
			},
			error:function(data) {
				alert("系统繁忙，稍后再试！");
			}
		});
	}
}
</script>
</body>
</html>

